#include <stdio.h>
#include <sys/types.h>
#include <sts/stat.h>
#include <fcntl.h>
#include <unistd>


int main()
{
    int fg = open("./log.txt", O_WRONLY, 0666);
    if(fg<0)
    {
        perror("open error");
        return -1;
    }

    const char* meg = "hello world\n";
    for(int i = 0; i<5; i++)
    {
        write(fg, meg, sizeof(meg));
    }

    close(fg);
    return 0;
}

